package com.teapos.enumtype;

public enum CustomerTypeEnum {
	
	//GYS(1, "供应商"),
	DLS(2, "代理商"),
	PFS(3, "批发商"),
	JCZ(4, "寄存者"),
	SCJ(5, "收藏家"),
	HY(6, "会员"),
	VIP(7, "VIP销售"),
	//PSY(8, "配送员"),
	PT(9, "普通销售");
	
	private int code;
	private String desc;
	private CustomerTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public CustomerTypeEnum getEnumByCode(int code) {
		CustomerTypeEnum[] enums = CustomerTypeEnum.values();
		for(CustomerTypeEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
